package com.candy.candylog.business.controller;

import com.alibaba.fastjson2.JSONObject;
import com.candy.candycommon.utils.ResultBean;
import com.candy.candylogservice.dto.LogLinkDTO;
import com.candy.candylogservice.service.DubboLogLinkService;
import lombok.extern.slf4j.Slf4j;
//import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author suYanLong
 * @version 1.0
 * @date 2023/5/29 10:33
 * @Description dubbo服务提供者
 */
@Slf4j
@RestController
@RequestMapping("/logLink1")
//@DubboService
public class DubboLogLinkController implements DubboLogLinkService {

    @PostMapping("save")
    @Override
    public ResultBean save(@RequestBody LogLinkDTO logLinkDTO) {
        log.info("保存日志" + JSONObject.toJSONString(logLinkDTO));
        logLinkDTO.setId(System.currentTimeMillis());
        return ResultBean.ok(logLinkDTO);
    }

}
